<?php

namespace App\Models\Admin;

use App\User;
class OperateLogs extends Base
{
    protected $table = 'operate_logs';

    protected $dateFormat = 'U';

    public $timestamps = true;

    protected $guarded = [];

    public function module()
    {
        return $this->hasOne(OperateMoudel::class,'id','module')->select('id','name');
    }

    public function operate()
    {
        return $this->hasOne(OperateMoudel::class,'id','operate')->select('id','name');
    }

    public function type()
    {
        return $this->hasOne(OperateType::class,'id','type')->select('id','name');
    }

    public function admin()
    {
        return $this->hasOne(User::class,'id','user_id')->select('id','name');
    }
}
